Skip to content
This repository was archived by the owner on Apr 20, 2023. It is now read-only.

Fix P2P migration and migrate folders in global.json - #4305

Merged
Sridhar-MS merged 3 commits into
rel/1.0.0from
sridhar-ms/migrate-p2p-fix
Oct 6, 2016
Merged

Sridhar-MS merged 3 commits into
rel/1.0.0from
sridhar-ms/migrate-p2p-fix

Conversation

@Sridhar-MS

Copy link
Copy Markdown

Fixes #4269 by deep cloning the MsbuildTemplateProject for each P2P reference. Add test which migrates and builds P2P references.

@brthor @livarcocc @eerhardt

@Sridhar-MS
Sridhar-MS force-pushed the sridhar-ms/migrate-p2p-fix branch 2 times, most recently from 41fa05a to 56b0e38 Compare October 5, 2016 05:14
@Sridhar-MS Sridhar-MS changed the title [WIP-Do not merge] Fix P2P migration and migrate folders in global.json Fix P2P migration and migrate folders in global.json Oct 5, 2016
namespace Microsoft.DotNet.ProjectJsonMigration
{
internal class ProjectDependencyFinder
public class ProjectDependencyFinder

This comment was marked as spam.

This comment was marked as spam.

var dependencies = settings["dependencies"] as JObject;

globalSettings.ProjectPaths = projects == null ? new string[] { } : projects.Select(a => a.Value<string>()).ToArray();;
globalSettings.ProjectPaths = projects == null ? new string[] { } : projects.Select(a => a.Value<string>()).ToArray(); ;

This comment was marked as spam.

This comment was marked as spam.

var projectDirectory = Path.GetDirectoryName(project);
var outputDirectory = projectDirectory;
var migrationSettings = new MigrationSettings(projectDirectory, outputDirectory, sdkVersion, msBuildTemplate, _xprojFilePath);
var migrationSettings = new MigrationSettings(projectDirectory, outputDirectory, sdkVersion, msBuildTemplate.DeepClone(), _xprojFilePath);

This comment was marked as spam.

This comment was marked as spam.

throw new Exception($"Unable to find global settings file at {globalJson}");
}

var searchPaths = ProjectDependencyFinder.GetGlobalPaths(Path.GetDirectoryName(globalJson));

This comment was marked as spam.

This comment was marked as spam.

" If a directory is specified, then it will recursively search for project.json files to migrate." +
" Defaults to current directory if nothing is specified.");
CommandArgument projectArgument = app.Argument("<PROJECT_JSON/GLOBAL_JSON/PROJECT_DIR>",
"The path to " + Environment.NewLine +

This comment was marked as spam.

This comment was marked as spam.

Exception exc = null;
IEnumerable<ProjectDependency> projectDependencies = null;

var tempMSBuildProjectTemplate = rootSettings.MSBuildProjectTemplate.DeepClone();

This comment was marked as spam.

This comment was marked as spam.

@eerhardt

eerhardt commented Oct 5, 2016

Copy link
Copy Markdown
Member

:shipit:

1 similar comment
@livarcocc

Copy link
Copy Markdown

:shipit:

var projectExportName = projectExport.Library.Identity.Name;
ProjectDependency projectDependency;

if (preResolvedProjects.Contains(projectExportName))

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

Fixes #4269 by deep cloning the MsbuildTemplateProject for each P2P reference. Add test which migrates and builds P2P references.
@Sridhar-MS
Sridhar-MS force-pushed the sridhar-ms/migrate-p2p-fix branch from 56b0e38 to 15a6730 Compare October 6, 2016 00:32
@livarcocc

Copy link
Copy Markdown

@dotnet-bot Test OSX x64 Release Build

@Sridhar-MS
Sridhar-MS force-pushed the sridhar-ms/migrate-p2p-fix branch from 15a6730 to c606467 Compare October 6, 2016 00:59
@Sridhar-MS
Sridhar-MS merged commit 5c6e3a0 into rel/1.0.0 Oct 6, 2016
@livarcocc
livarcocc deleted the sridhar-ms/migrate-p2p-fix branch October 19, 2016 22:18
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants